import { StationVO } from '@/api/station/types';
import { VxeGridProps } from 'vxe-table';
import { BizStationLeakDetectVo } from '@/api/station/leak/types';

export function getTableConfig(): VxeGridProps<BizStationLeakDetectVo> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',

    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', type: 'seq', width: 50 },
      { sortable: true, field: 'stationName', title: '站房名称' },
      { sortable: true, field: 'detectId', title: '监测任务ID' },
      { sortable: true, field: 'vendorIds', title: '关联酒店名称' },
      { sortable: true, field: 'startFrom', title: '监测时间段' },
      { sortable: true, field: 'currentPressure', title: '压力值(帕)' },
      { sortable: true, field: 'status', title: '任务执行状态' },
      { sortable: true, field: 'deviceId', title: '装备ID' },
      { sortable: true, field: 'pkeepTime', title: '保压时长（秒）' },
      { sortable: true, field: 'measureResult', title: '是否泄露', formatter: ({ row }) => (row.measureResult ? '是' : '否') },
      { sortable: true, field: 'reportTime', title: '报告时间' }
    ],
    data: [] as BizStationLeakDetectVo[]
  };
}
